home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-27 | 3.0 KB | 99 lines | [TEXT/CWIE] |
- // ===========================================================================
- // LNotificationTask.h © 1995, Éric Forget. All rights reserved.
- // ===========================================================================
- //
- // ************************************************************************
- // * *
- // * Before using this code you should read the "License Agreement" *
- // * document and agree with it. *
- // * *
- // ************************************************************************
- //
- // Instruction and usage notes are in the LNotificationTask.cp file.
- //
- // ---------------------------------------------------------------------------
-
-
- #pragma once
-
- #ifndef __NOTIFICATION__
- #include <Notification.h>
- #endif // __NOTIFICATION__
-
- #include "LTask.h"
- #include <LPeriodical.h>
-
-
- class LNotificationTask;
-
-
- // ---------------------------------------------------------------------------
- // • Structure SVBLTaskT
- // ---------------------------------------------------------------------------
-
- struct SNoteTaskT {
-
- NMRec task;
- #if !GENERATINGCFM
- Int32 A5World;
- #endif
- LNotificationTask *noteTask;
- };
-
-
- // ---------------------------------------------------------------------------
- // • Class LNotificationTask
- // ---------------------------------------------------------------------------
-
- class LNotificationTask : public LTask,
- public LPeriodical {
-
- private:
- LNotificationTask() {} // Impossible constructor!
- public:
- LNotificationTask(StringPtr inDescriptor,
- ResIDT inStringID = 0,
- ResIDT inIconFamilyID = -1,
- Handle inSoundH = (Handle)-1L,
- Int16 inMark = 1,
- Boolean inDeleteOnCompletion = true);
- virtual ~LNotificationTask();
-
- void SetIndString(ResIDT inStringListID,
- ResIDT inStringIndex)
- {
- ::GetIndString(mDescriptor, inStringListID, inStringIndex);
- mNoteTask.task.nmStr = mDescriptor[0] ? mDescriptor : nil;
- }
- void SetIconFamily(ResIDT inIconFamilyID)
- {
- ::GetIconSuite(&mNoteTask.task.nmIcon, inIconFamilyID, svAllSmallData);
- }
- void SetSoundHandle(Handle inSoundH)
- {
- mNoteTask.task.nmSound = inSoundH;
- }
- void SetSound(ResIDT inSoundID)
- {
- mNoteTask.task.nmSound = ::GetResource('snd ', inSoundID);
- }
- virtual void StartTask();
- virtual void StopTask();
- virtual void SpendTime(const EventRecord &inMacEvent);
-
- protected:
- static NMUPP sTaskUPP;
- Str255 mDescriptor;
- SNoteTaskT mNoteTask;
- Boolean mUserHasSeenNote;
- ProcessSerialNumber mApplicationPSN;
-
-
- static pascal void TaskUPP(SNoteTaskT *inNoteTaskPtr);
- virtual void ContinueTask();
-
- virtual void StartTaskSelf();
- virtual void ExecuteTaskSelf(Boolean &ioLastCall);
- virtual void StopTaskSelf();
- };
-